package com.zy.config.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zy.config.dto.AppConfigQueryDto;
import com.zy.config.entity.AppConfig;
import com.zy.config.mapper.AppConfigMapper;
import com.zy.config.service.AppConfigService;
import com.zy.db.utils.QueryUtils;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;

import javax.validation.Valid;
import java.util.List;

/**
 * @author zy
 * @description:
 * @since 2023/3/18 23:06
 */
@Service
@Validated
public class AppConfigServiceImpl extends ServiceImpl<AppConfigMapper, AppConfig> implements AppConfigService {


    /**
     * 获取配置
     *
     * @param dto
     * @return
     */
    @Override
    public List<AppConfig> getConfigId(@Valid AppConfigQueryDto dto) {
        QueryWrapper queryWrapper = QueryUtils.getParam(new QueryWrapper<AppConfig>(), dto, AppConfigQueryDto.class);
        return this.list(queryWrapper);
    }

}
